import VueRouter from 'vue-router';

//导入组件
import Home from './components/tabbar/Home.vue';
import Member from './components/tabbar/Member.vue';
import Shopcar from './components/tabbar/Shopcar.vue';
import Search from './components/tabbar/Search.vue';
import newsList from './components/news/newsList.vue';
import newsInfo from './components/news/newsInfo.vue';
import photoList from './components/photo/photoList.vue';
import photoInfo from './components/photo/photoInfo.vue';
import goodList from './components/goods/goodList.vue';
import goodInfo from './components/goods/goodsInfo.vue';
import desc from './components/goods/desc.vue';
import comment from './components/goods/comment.vue';


//创建路由对象
var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home'}, //路由重定向
        { path: '/home', component: Home},
        { path: '/member', component: Member},
        { path: '/shopcar', component: Shopcar},
        { path: '/search', component: Search},
        { path: '/home/newsList', component: newsList},
        { path: '/home/newsInfo/:id', component: newsInfo},
        { path: '/home/photoList', component: photoList},
        { path: '/home/photoInfo/:id', component: photoInfo},
        { path: '/home/goodList', component: goodList},
        { path: '/home/goodsInfo/:id', component: goodInfo},
        { path: '/home/desc/:id', component:desc , name: "desc"},
        { path: '/home/comment/:id',component:comment , name: "comment"}
    ],
    linkActiveClass: 'mui-active'  //点击显示高亮
})

//把路由对象暴露出去
export default router;
